home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / SDI / FIND.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-16  |  4.7 KB  |  149 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFind 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Find"
  5.    ClientHeight    =   1395
  6.    ClientLeft      =   1500
  7.    ClientTop       =   1875
  8.    ClientWidth     =   4950
  9.    BeginProperty Font 
  10.       Name            =   "MS Sans Serif"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   700
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    LinkTopic       =   "Form2"
  19.    MaxButton       =   0   'False
  20.    MinButton       =   0   'False
  21.    ScaleHeight     =   1395
  22.    ScaleWidth      =   4950
  23.    Begin VB.Frame Frame1 
  24.       Caption         =   "Direction"
  25.       Height          =   612
  26.       Left            =   1560
  27.       TabIndex        =   3
  28.       Top             =   720
  29.       Width           =   2052
  30.       Begin VB.OptionButton optDirection 
  31.          Caption         =   "&Down"
  32.          Height          =   252
  33.          Index           =   1
  34.          Left            =   960
  35.          TabIndex        =   5
  36.          ToolTipText     =   "Search to End of Document"
  37.          Top             =   240
  38.          Value           =   -1  'True
  39.          Width           =   852
  40.       End
  41.       Begin VB.OptionButton optDirection 
  42.          Caption         =   "&Up"
  43.          Height          =   252
  44.          Index           =   0
  45.          Left            =   240
  46.          TabIndex        =   4
  47.          ToolTipText     =   "Search to Beginning of Document"
  48.          Top             =   240
  49.          Width           =   612
  50.       End
  51.    End
  52.    Begin VB.CheckBox chkCase 
  53.       Caption         =   "Match &Case"
  54.       Height          =   495
  55.       Left            =   120
  56.       TabIndex        =   2
  57.       ToolTipText     =   "Case Sensitivity"
  58.       Top             =   720
  59.       Width           =   1335
  60.    End
  61.    Begin VB.TextBox txtFind 
  62.       Height          =   500
  63.       Left            =   1200
  64.       TabIndex        =   1
  65.       ToolTipText     =   "Text to Find"
  66.       Top             =   120
  67.       Width           =   2415
  68.    End
  69.    Begin VB.CommandButton cmdcancel 
  70.       Cancel          =   -1  'True
  71.       Caption         =   "Cancel"
  72.       Height          =   372
  73.       Left            =   3720
  74.       TabIndex        =   7
  75.       ToolTipText     =   "Return to Notepad"
  76.       Top             =   600
  77.       Width           =   1092
  78.    End
  79.    Begin VB.CommandButton cmdFind 
  80.       Caption         =   "&Find"
  81.       Default         =   -1  'True
  82.       Height          =   372
  83.       Left            =   3720
  84.       TabIndex        =   6
  85.       ToolTipText     =   "Start Search"
  86.       Top             =   120
  87.       Width           =   1092
  88.    End
  89.    Begin VB.Label Label1 
  90.       Caption         =   "Fi&nd What:"
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   0
  94.       Top             =   240
  95.       Width           =   975
  96.    End
  97. Attribute VB_Name = "frmFind"
  98. Attribute VB_Base = "0{8EC00D58-E9E4-11CF-84BA-00AA00C007F0}"
  99. Attribute VB_GlobalNameSpace = False
  100. Attribute VB_Creatable = False
  101. Attribute VB_TemplateDerived = False
  102. Attribute VB_PredeclaredId = True
  103. Attribute VB_Exposed = False
  104. '*** Find dialog box for searching text.        ***
  105. '*** Created for SDI Notepad sample application ***
  106. '*** Uses: public variables gFindCase (toggles  ***
  107. '*** case sensitivity); gFindString (text to    ***
  108. '*** find); gFindDirection (toggles search      ***
  109. '*** direction); gFirstTime (toggles start from ***
  110. '*** beginning of text)                         ***
  111. '**************************************************
  112. Option Explicit
  113. Private Sub chkCase_Click()
  114.     ' Assign a value to the public variable.
  115.     gFindCase = chkCase.Value
  116. End Sub
  117. Private Sub cmdCancel_Click()
  118.     ' Save the values to the public variables.
  119.     gFindString = txtFind.Text
  120.     gFindCase = chkCase.Value
  121.     ' Unload the find dialog.
  122.     Unload frmFind
  123. End Sub
  124. Private Sub cmdFind_Click()
  125.     ' Assigns the text string to a public variable.
  126.     gFindString = txtFind.Text
  127.     FindIt
  128. End Sub
  129. Private Sub Form_Load()
  130.     ' Disable the find button - no text to find yet.
  131.     cmdFind.Enabled = False
  132.     ' Read the public variable & set the option button.
  133.     optDirection(gFindDirection).Value = 1
  134. End Sub
  135. Private Sub optDirection_Click(Index As Integer)
  136.     ' Assign a value to the public variable.
  137.     gFindDirection = Index
  138. End Sub
  139. Private Sub txtFind_Change()
  140.     ' Set the public variable.
  141.     gFirstTime = True
  142.     ' If the textbox is empty, disable the find button.
  143.     If txtFind.Text = "" Then
  144.         cmdFind.Enabled = False
  145.     Else
  146.         cmdFind.Enabled = True
  147.     End If
  148. End Sub
  149.